#! /usr/bin/env python
# -*- coding: utf-8 -*-

# *************************************************************
#     Filename @  urlerror.py
#       Author @  Huoty
#  Create date @  2015-06-19 15:29:21
#  Description @  
# *************************************************************

import urllib2

# Script starts from here

requset = urllib2.Request("http://www.xxxx.com")
try:
    urllib2.urlopen(requset)
except urllib2.URLError, e:
    print e.reason
